package com.zkl.push.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zkl.push.model.WxopenSubscriptionMessageData;
import com.zkl.push.mapper.WxopenSubscriptionMessageDataMapper;
import com.zkl.push.service.WxopenSubscriptionMessageDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
/**
 * <p>
 * 品牌商订阅消息数据表 服务实现类
 * </p>
 *
 * @author gongxz
 * @since 2020-01-06
 */
@Service
@Transactional
public class WxopenSubscriptionMessageDataServiceImpl extends ServiceImpl<WxopenSubscriptionMessageDataMapper, WxopenSubscriptionMessageData> implements WxopenSubscriptionMessageDataService {

    @Autowired
    private WxopenSubscriptionMessageDataMapper wxopenSubscriptionMessageDataMapper;

    @Override
    public IPage<WxopenSubscriptionMessageData> selectPage(Page<WxopenSubscriptionMessageData> page, WxopenSubscriptionMessageData wxopenSubscriptionMessageData) {
        QueryWrapper<WxopenSubscriptionMessageData> queryWrapper = new QueryWrapper<WxopenSubscriptionMessageData>();
        getQueryWrapper(queryWrapper,wxopenSubscriptionMessageData);
        return wxopenSubscriptionMessageDataMapper.selectPage(page,queryWrapper);
    }

    @Override
    public List<WxopenSubscriptionMessageData> selectList(WxopenSubscriptionMessageData wxopenSubscriptionMessageData) {
        QueryWrapper<WxopenSubscriptionMessageData> queryWrapper = new QueryWrapper<WxopenSubscriptionMessageData>();
        getQueryWrapper(queryWrapper,wxopenSubscriptionMessageData);
        return wxopenSubscriptionMessageDataMapper.selectList(queryWrapper);
    }

    /**
     *  公共查询条件
     * @param queryWrapper
     * @return
     */
    public QueryWrapper<WxopenSubscriptionMessageData> getQueryWrapper(QueryWrapper<WxopenSubscriptionMessageData> queryWrapper,WxopenSubscriptionMessageData wxopenSubscriptionMessageData){
        //条件拼接
    
        return queryWrapper;
    }
}
